<?php

namespace frontend\modules\spread\models;

use Yii;
use common\helpers\Url;
use common\helpers\ArrayHelper;
use common\logics\ShopProductLogic;
use common\logics\PositionLogic;

/**
 * 会员栏信息
 *
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class SpreadMemberSearch extends \common\models\member\Member {

    public static function findByUid($uid) {
        return static::find()->active()->andWhere([
            'and',
            ['user_id' => $uid],
            ['audit_status' => static::AUDIT_STATUS_FINISH],
            ['status' => static::STATUS_ACTIVE],
        ])->one();
    }

    public function fields() {
        return [
            'id',
            'user_id',
            'type_id',
            'level_id',
            'qrcode',
            'realname',
            'avatar',
        ];
    }

}
